const { getAllBannersDao, setBannersDao } = require("../dao/bannerDao");

exports.getAllBanners =  async () => {
    const result = await getAllBannersDao();

    // 将数据格式化一下并返回
    return result.map(item => {
        return item.dataValues;
    })
}

exports.setBanners = async (newBanners) => {
    const result = await setBannersDao(newBanners);
    return result.map(item => {
        return item.dataValues;
    })
}